package com.report.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.file.entity.FileTerminal;
import com.report.entity.OnlineTerminal;
import com.report.service.OnlineterminalReportService;
import com.utils.JsonResult;;

/**   
* @Title: OnlineterminalReportController.java 
* @Package com.report.controller 
* @author 孙梦楠 
* @date 2017年9月28日 上午11:10:16 
* @version V1.0.0   
*/
@RestController
@RequestMapping(value = "/report")
public class OnlineterminalReportController {
	
	@Autowired
	private OnlineterminalReportService onlineterminalreportservice;
	
	@RequestMapping(value = "/online_terminal", method = RequestMethod.GET)
	public JsonResult<Object[][]> recordreportLine (
			@CookieValue(value = "opeorgcookie", required = false) String opeorgcookie,
			@CookieValue(value = "opetypecookie", required = false) String opetypecookie){
		
		
		return onlineterminalreportservice.onlineterminalReport(opeorgcookie, opetypecookie);
	}
	
	@RequestMapping(value = "/offline_terminal_table", method = RequestMethod.POST)
	public JsonResult<List<FileTerminal>> listOfflineTerminal(
			@RequestBody OnlineTerminal onlineTerminal,
			@CookieValue(value = "opeorgcookie", required = false) String opeorgcookie, 
			@CookieValue(value = "opetypecookie", required = false) String opetypecookie,
			@CookieValue(value = "languagecookie", required = false) String languagecookie){
		
		String status = onlineTerminal.getStatus();
		
		
		return onlineterminalreportservice.listOfflineTerminal(opeorgcookie, opetypecookie, languagecookie,status);
	}
	
	

}
